import request from '@/utils/request_zc'

export function getIncomingInspectionList ({
  serialNo,
  issueNo,
  materialName,
  inspector,
  inspectionStartDate,
  inspectionEndDate,
  page, limit }) {
  return request({
    url: '/mes/material/inspection/list',
    method: 'get',
    params: {
      page,
      limit,
      serialNo,
      issueNo,
      materialName,
      inspector,
      inspectionStartDate,
      inspectionEndDate,
    }
  })
}

export function getissueList () {
  return request({
    url: '/mes/material/issue/list',
    method: 'get'
  })
}

export function getissueDetailList ({ id }) {
  return request({
    url: `/mes/material/issue/detail/${id}`,
    method: 'get'
  })
}


export function editIncomingInspection ({
  demandQuantity,
  id,
  inspectionResult,
  inspectionValue,
  issueId,
  issueQuantity,
  materialId,
  remark,
  samplingQuantity,
  serialNo
}) {
  return request({
    url: '/mes/material/inspection/edit',
    method: 'post',
    data: {
      demandQuantity,
      id,
      inspectionResult,
      inspectionValue,
      issueId,
      issueQuantity,
      materialId,
      remark,
      samplingQuantity,
      serialNo
    }
  })
}

export function addIncomingInspection ({
  demandQuantity,
  inspectionResult,
  inspectionValue,
  issueId,
  issueQuantity,
  materialId,
  remark,
  samplingQuantity,
  serialNo
}) {
  return request({
    url: '/mes/material/inspection/add',
    method: 'post',
    data: {
      demandQuantity,
      inspectionResult,
      inspectionValue,
      issueId,
      issueQuantity,
      materialId,
      remark,
      samplingQuantity,
      serialNo
    }
  })
}

export function delIncomingInspection (data) {
  return request({
    url: '/mes/material/inspection/del',
    method: 'post',
    data
  })
}
